<meta charset="UTF-8">
<div id="loading"></div>
<script>
    var strs = ["加载中","加载中.","加载中..","加载中..."];

    var i = 0;
    loading.innerHTML = strs[0];

    setInterval(function(){
        if(i==3) i = -1;
        loading.innerHTML = strs[++i];
    },300);
</script>
